<template>
  <router-view></router-view>
</template>

<script setup lang="ts">
import {onMounted, watch} from "vue";
import { useRoute } from 'vue-router';
import useMenuTabs from "@/store/modules/useMenuTabs.ts";
let menuTabs=useMenuTabs();
let route=useRoute();
onMounted(() => {
  console.log('--------- 根文件监听 ---------')
})
// 使用 watch 来监听路由对象的变化
watch(() => route.path, (newPath, oldPath) => {
  console.log(`路由从 ${oldPath} 变化到 ${newPath}`);
  menuTabs.addTab(route.meta.title,route.path)
});
</script>

<style scoped>

</style>
